package com.dongdongsongcan.app.view;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.dongdongsongcan.app.R;
import com.dongdongsongcan.app.control.bean.OrderStatusData;
import com.su.dolphin.utils.ViewUtil;

public class OrderStatusItem extends BaseViewItem<OrderStatusData.Status> {

    private final ImageView orderstatus_status;
    private final TextView orderstatus_des;
    private final TextView orderstatus_time;
    private TextView mAddressitem_user;
    private TextView mAddressitem_address;

    public OrderStatusItem(Context context) {
        mContainer = ViewUtil
                .inflateView(R.layout.layout_orderstatus_item, context);
        orderstatus_status = (ImageView) mContainer
                .findViewById(R.id.orderstatus_status);
        orderstatus_des = (TextView) mContainer
                .findViewById(R.id.orderstatus_des);
        orderstatus_time = (TextView) mContainer
                .findViewById(R.id.orderstatus_time);

    }

    public void setInfo(OrderStatusData.Status status) {
        if (status == null) {
            return;
        }
        if (status.getMark() == 0) {
            orderstatus_status.setImageResource(R.drawable.order_statuscheck_grey);
        } else {
            orderstatus_status.setImageResource(R.drawable.order_statuscheck);

        }

        orderstatus_des.setText(status.getStatus());
        orderstatus_time.setText(status.getCreate_time());
    }

}
